<template>
	<view class="page">
		<view class="doctorbox" @click="gomyinfo">
			<view class="doctorleft">
				<view class="imgbox">
					<image  :src="pro.dAvatarUrl ? 'https://changban.dianjingkeji.net' + pro.dAvatarUrl : 'https://changban.dianjingkeji.net/img/微信图片_20250923172704_692_133.jpg'" mode=""></image>
				</view>
			
			
			</view>
			<view class="doctorinfo">
				<view class="callwater"  @click.stop="callwiter">
					<view class="iconfont icon-kefu"></view>
					联系客服
				</view>
			<view class="name">
				{{pro.dName||''}}
			</view>
			<view class="lever">
				{{pro.usertype==1?'团长':'团员'}}
			</view>
		
			
			</view>
		</view>
		
		
		<button class="tipbox" style="text-align: center;"  @click="jumpToSpecificAccount">
			 关注公众号,接受更多消息
		</button>
		
		<view class="bannerbox">
			<view class="bannertitle">
				财务总览
			</view>
			
			<view class="bannerlist">
				<view class="itembanner" @click="qianbao">
					
					<view class="iconfont icon-kabao">
						
					</view>
					<view class="bannername">
						我的钱包
					</view>
				</view>
				<view class="itembanner" @click="zhangdan">
					
					<view class="iconfont icon-shuju-05">
						
					</view>
					<view class="bannername">
						每月账单
					</view>
				</view>
				<view class="itembanner" @click="dakuanjilu">
					
					<view class="iconfont icon-shoukuandan">
						
					</view>
					<view class="bannername">
						打款记录
					</view>
				</view>
			
				<view class="itembanner" @click="bankcard">
					
					<view class="iconfont icon-qiapian">
						
					</view>
					<view class="bannername">
						银行卡
					</view>
				</view>
				<view class="itembanner">
					
					<view class="iconfont icon-wentifankui">
						
					</view>
					<view class="bannername">
						常见问题
					</view>
				</view>
				
			</view>
		</view>
		
		<view class="linebox">
			<view class="itemline" @click="tuijianma(pro.tuijiadoctorqrcode)">
				<view class="lineleft">
					<view class="yuan">
						<view class="iconfont icon-fenxiang1">
							
						</view>
					</view>
					<view class="linename">
					向医生分享我的名片
					</view>
				</view>
				<view class="iconfont icon-xiangyou1">
					
				</view>
			</view>
			<view class="itemline" @click="tuijianma(pro.tuijiancode)">
				<view class="lineleft">
					<view class="yuan">
						<view class="iconfont icon-fenxiang1">
							
						</view>
					</view>
					<view class="linename">
					向用户分享我的名片
					</view>
				</view>
				<view class="iconfont icon-xiangyou1">
					
				</view>
			</view>
			
		</view>
		

		<view class="winpage" v-if="winshow">
			<view class="win">
				<view class="wintitle">
					分享给好友
					<view class="iconfont icon-guanbi" @click="winshow=false">
						
					</view>
				</view>
				<view class="cardbox" >
					
				    <image :src="'https://changban.dianjingkeji.net'+sanurl"  @click="lookinfocard(sanurl)"></image>
					 <!-- <image src="https://changban.dianjingkeji.net/img/微信图片_20250923172704_692_133.jpg"  @click="lookinfocard(sanurl)"></image> -->
				</view>
				
				<view class="btnbox">
				<!-- 	<button open-type="share" class="itembtn" >
						<view class="iconfont icon-weixin1 weixin">
							
						</view>
						<view class="btnname">
							微信
						</view>
					</button> -->
					<!-- <view class="itembtn" @click="drawPoster">
						<view class="iconfont icon-xiazai xiazai">
							
						</view>
						<view class="btnname">
						保存
						</view>
					</view> -->
			
				</view>
			</view>
		</view>
	   <view class="winpage" v-if="callshow"  @click="callshow=false">
	   	<view class="callwin">
			<view class="title">
				扫描二维码添加企业微信
			</view>
			<view class="iconfont icon-guanbi" @click="callshow=false">
				
			</view>
	   		<image src="https://changban.dianjingkeji.net/img/lianxi.png" @click.stop="lookcard('https://changban.dianjingkeji.net/img/lianxi.png')"></image>
			
	   	</view>
	   </view>
	
		
		<view class="foot-tabbar" >
			<view class="itemfootbar" @click="goxueshu">
				<image src="/static/tabbar/学位帽.png" mode=""></image>
				<view class="tabbarname ">
					学术
				</view>
			</view>
			<view class="itemfootbar" @click="gouser">
				<image src="/static/tabbar/首页 (1).png" mode=""></image>
				<view class="tabbarname  ">
					用户
				</view>
			</view>
		
		
			<view class="itemfootbar" @click="goteam" >
				<image src="/static/tabbar/团队.png" mode=""></image>
				<view class="tabbarname ">
				成员
				</view>
			</view>
			<view class="itemfootbar" >
				<image src="/static/tabbar/我 的.png" mode=""></image>
				<view class="tabbarname footact">
					我的
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
		import {myinfo} from '../../utils/daili.js'
	export default {
		data() {
			return {
				login:false,
				callshow:false,
				pro:{
					
				},
				sanurl:'',
				winshow:false,
				 officialAccountInfo: {
				        
				        originalId: 'gh_664742c846e1'
				        
				      }
				
			}
		},

		onShow() {
		 let p={
			phone:uni.getStorageSync('phone')
		 }
		 myinfo(p).then(res=>{
			 console.log(res)
			 this.pro=res.data.data
		 })
		},
		methods: {
			
			tuijianma(e){
				console.log(e)
				this.sanurl=e
				this.winshow=true
			},
			denglu(){
				uni.navigateTo({
					url:'/pages/login/login'
				})
			},
			
			callwiter(){
				this.callshow=true
			},
			gomyinfo(){
				if(this.pro.reviewerstatus==1){
					uni.navigateTo({
						url:'/pagesA/myinfo/myinfo'
					})
				}
				
			},
			
			
			//把名片保存成图片
			drawPoster() {
						   const ctx = uni.createCanvasContext('poster-canvas');
						   
						   // 1. 下载并绘制背景图
						   uni.downloadFile({
						     url: 'https://changban.dianjingkeji.net/img/banner-1-拷贝.jpg',
						     success: (res) => {
						       if (res.statusCode === 200) {
						         // 绘制背景图
						         ctx.drawImage(res.tempFilePath, 0, 0, 750, 1000);
						         console.log(this.pro.dAvatarUrl)
						         // 2. 绘制头像（需先下载网络图片）
						         uni.downloadFile({
						           url: `https://changban.dianjingkeji.net${this.pro.dAvatarUrl}`,
						           success: (res) => {
						             const imgPath = res.tempFilePath;
						             ctx.drawImage(imgPath, 30, 30, 130, 130);
						             
						             // 3. 绘制文字
						             ctx.setFontSize(16);
						             ctx.setFillStyle('#333333');
						             ctx.fillText(this.pro.dName, 200, 70);
						             // 4. 绘制标题和描述
						             ctx.setFontSize(18);
						             ctx.fillText('离院有人管', 10, 220);
						             ctx.setFontSize(14);
						             ctx.fillText('健康管理没有终点，我们为您提供7*24小时的在线陪伴与指导', 10, 240);
									 ctx.setFontSize(18);
									 ctx.fillText('有问随时答', 10, 280);
									 ctx.setFontSize(14);
									 ctx.fillText('点击下方卡片，立即加入专属服务群，', 10, 310);
									 ctx.setFontSize(14);
									 ctx.fillText('激活您的专属生活方式管理服务。', 10, 330);
						              console.log(this.pro.tuijiancode,'推荐码')
						             // 5. 绘制底部二维码（需先下载）
						             uni.downloadFile({
										 
						               url: `https://changban.dianjingkeji.net${this.sanurl}`,
						               success: (res) => {
						                 const qrPath = res.tempFilePath;
						                 ctx.drawImage(qrPath, 200, 380, 150, 150);
						                 
						                 // 6. 绘制底部文字
						                 ctx.setFontSize(12);
						                 ctx.fillText('长按/扫码关注', 50, 380);
						                 ctx.fillText('加入我的工作室', 50, 410);
						                 
						                 // 7. 保存图片
						                 ctx.draw(true, () => {
						                   uni.canvasToTempFilePath({
						                     canvasId: 'poster-canvas',
						                     success: (res) => {
						                       uni.saveImageToPhotosAlbum({
						                         filePath: res.tempFilePath,
						                         success: () => uni.showToast({ title: '保存成功' }),
						                         fail: (err) => console.error(err)
						                       });
						                     }
						                   });
						                 });
						               }
						             });
						           }
						         });
						       } else {
						         uni.showToast({ title: '背景图下载失败', icon: 'none' });
						       }
						     }
						   });
						 },
						
						sendeweixin(){
							uni.share({
								provider: "weixin",
								scene: "WXSceneSession",
								type: 1,
								summary: "我正在使用6X一生长伴，赶紧跟我一起来体验！",
								success: function (res) {
									console.log("success:" + JSON.stringify(res));
								},
								fail: function (err) {
									console.log("fail:" + JSON.stringify(err));
								}
							});
						},
			jumpToSpecificAccount() {
			    wx.openOfficialAccountProfile({
			             username: 'gh_664742c846e1', // 此处填写公众号的原始 ID
			             success: res => {
			             },
			             fail: res => {
			             }
			         })
			    },
				 
		
			lookinfocard(){
				let that=this
				uni.previewImage({
							urls: ['https://changban.dianjingkeji.net'+that.sanurl],
							longPressActions: {
								itemList: ['发送给朋友', '保存图片', '收藏'],
								success: function(data) {
									console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
								},
								fail: function(err) {
									console.log(err.errMsg);
								}
							}
						});
			},
			
			lookcard(e){
				let that=this
				uni.previewImage({
							urls: [e],
							longPressActions: {
								itemList: ['发送给朋友', '保存图片', '收藏'],
								success: function(data) {
									console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
								},
								fail: function(err) {
									console.log(err.errMsg);
								}
							}
						});
			},
			dakuanjilu(){
				uni.navigateTo({
					url:'/pagesA/dakuanlist/dakuanlist'
				})
			},
			
			zhangdan(){
				uni.navigateTo({
					url:'/pagesA/zhangdan/zhangdan'
				})
			},
			qianbao(){
				uni.navigateTo({
					url:'/pagesA/wallet/wallet'
				})
			},
			
			bankcard(){
				uni.navigateTo({
					url:'/pagesA/bankcard/bankcard'
				})
			},
			waitlook(){
				uni.showToast({
					title: '敬请期待',
					icon:'none',
					duration: 2000
				});

			},
	      gouser(){
			  uni.redirectTo({
			  	url:'/pages/newuser/newuser'
			  })
		  },
	
			goxueshu(){
				uni.redirectTo({
					url:'/pages/newxueshu/newxueshu'
				})
			},
			
			goteam(){
				
			uni.redirectTo({
				url:'/pages/newteam/newteam'
			})
				
			},
		}
	}
</script>

<style lang="less" scoped>
  .page{
	  width: 750rpx;
	  padding: 20rpx;
	  background: whitesmoke;
	  box-sizing: border-box;
	  padding-bottom: 250rpx;
	 .doctorbox{
		 width: 100%;
		 box-sizing: border-box;
		 padding: 20rpx;
		 background-color: white;
		 border-radius: 20rpx;
		 display: flex;
		 align-items: center;
		   box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.3);
		 .doctorleft{
			 width: 30%;
			 height: 100%;
			 .imgbox{
				 width: 130rpx;
				 height: 130rpx;
				 border-radius: 50%;
				 margin: auto;
				
				  image{
					  width: 100%;
					  height: 100%;
					  border-radius: 50%;
				  }
			 }
			 .doctortype{
				 width: 130rpx;
				 font-weight: bold;
				 margin: auto;
				 margin-top: 40rpx;
				 text-align: center;
				 color: #FF3D00;
				 background-color: #FFEEE9;
				 font-size: 30rpx;
				 padding: 6rpx 10rpx;
				 border-radius: 20rpx;
				
			 }
			 
			 
		 }
		 .doctorinfo{
			 flex: 1;
			 position: relative;
			 margin-left: 20rpx;
			 box-sizing: border-box;
			 padding: 40rpx;
			.callwater{
			
				display: flex;
				align-items: center;
				font-size: 30rpx;
				color: #1D5A9F ;
				padding: 6rpx 10rpx;
				background-color: #EAF6FF;
				border-top-left-radius: 20rpx;
				border-bottom-left-radius: 20rpx;
				position: fixed;
				top: 40rpx;
				right: 20rpx;
				
				.iconfont{
					font-size: 40rpx;
					
				}
			 }
			 .name{
			 					 font-weight: bold;
			 }
			 .lever{
			 					 font-size: 30rpx;
			 					 color: gray;
			 }
			.doctorname{
				font-weight: bold;
				font-size: 40rpx;
				line-height: 2.5;
				display: flex;
				align-items: center;
				view{
					font-size: 32rpx;
					margin-left: 20rpx;
					margin-top: 8rpx;
				}
			 }
			 .labelbox{
				 color: gray;
				 line-height: 1.6;
				 font-weight: bold;
				 font-size: 30rpx;
			 }
			 .datatab{
				 width: 100%;
				 display: flex;
				 align-items: center;
				 justify-content: space-evenly;
				 margin-top: 20rpx;
				 .itemdata{
					 text-align: center;
					 .datanumber{
						 font-size: 36rpx;
						 font-weight: bold;
						 color: #1a4f8a;
					 }
					 .datalabel{
						 font-size: 30rpx;
						  color: gray;
						  width: 70rpx;
					 }
					 .kuan{
						 width: 100rpx; 
					 }
				 }
				 
			 }
			 
		 }
	 }
	 .tipbox{
		 width: 100%;
		 box-sizing: border-box;
		 display: flex;
		 align-items: center;
		 border-radius: 20rpx;
		 background-color: #FDEFEF ;
		
		 border: 1rpx solid #FF3D00;
		 padding: 10rpx 20rpx;
		 margin: 30rpx 0;
		 font-weight: bold;
		 justify-content: space-between;
	
		 .tipbtn{
			 color: #FF3D00;
			 margin-left: 20rpx;
			   text-decoration: underline;
			 
		 }
		 
	 }
	 .bannerbox{
		 width: 100%;
		 box-sizing: border-box;
		 padding: 20rpx;
		 background-color: white;
		 border-radius: 20rpx;
		   box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.3);
		   .bannertitle{
			   font-weight: bold;
		   }
		   .bannerlist{
			   width: 100%;
			   display: flex;
			   align-items: center;
			   flex-wrap: wrap;
			   .itembanner{
				   width: 33%;
				   font-weight: bold;
				   text-align: center;
				   margin-top: 30rpx;
				   line-height: 1.8;
				   .iconfont{
					   font-size: 50rpx;
					   color: #1a4f8a;
				   }
				   .bannername{
					   font-size: 30rpx;
				   }
			   }
		   }
	 }
	  .linebox{
		  width: 100%;
		  box-sizing: border-box;
		  padding: 20rpx;
		  background-color: white;
		  border-radius: 20rpx;
		    box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.3);
			margin-top: 60rpx;
			.itemline{
				width: 100%;
				height: 100rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1rpx solid whitesmoke;
				.lineleft{
					display: flex;
					align-items: center;
					font-weight: bold;
					.yuan{
						width: 80rpx;
						height: 80rpx;
						border-radius: 50%;
						line-height: 80rpx;
						text-align: center;
						background-color:#F3F4F9;
						margin-right: 30rpx;
						.iconfont{
							margin: auto;
							color: #1a4f8a;
						}
					}
				}
			}
	  }
	  .winpage{
	  		 width: 750rpx;
	  		 height: 100vh;
	  		 z-index: 99999;
	  		 background-color: rgba(0, 0, 0, 0.5);
	  		 position: fixed;
	  		 top: 0;
	  		 left: 0;
	  		 bottom: 0;
	  		 right: 0;
	  		 .win{
	  			 width: 100%;
	  			 height: 90%;
	  			 position: absolute;
	  			 top: 10vh;
	  			 bottom: 0;
	  			 left: 0;
	  			 right: 0;
	  			 background-color: #f1f1f1;
	  			 border-top-right-radius: 30rpx;
	  			 border-top-left-radius: 30rpx;
	  			 padding-top: 40rpx;
	  			 .wintitle{
	  				 width: 100%;
	  				 border-top: 1px solid #f1f1f1;
	  				 text-align: center;
	  				 position: relative;
	  				 padding-top: 10rpx;
	  				 .iconfont{
	  					 position: absolute;
	  					 top: 0;
	  					 right: 10rpx;
	  				 }
	  			 }
	  			 .cardbox{
	  				 width: 80%;
	  				  height: 50%;
	  				 margin: auto;
	  				 background-color: white;
	  				 margin-top: 20rpx;
	  				 border-radius: 30rpx;
	  				 position: relative;
					 image{
						 width: 100%;
						 height: 100%;
					 }
	  				 .backimg{
	  					 width: 100%;
	  					 height: 30%;
	  					 border-top-right-radius: 30rpx;
	  					 border-top-left-radius: 30rpx;
	  				 }
	  				 .infobox{
	  					 position: absolute;
	  					 top: 0;
	  					 left: 0;
	  					 right: 0;
	  					 box-sizing: border-box;
	  					 padding: 20rpx;
	  					 color: white;
	  					 .infotop{
	  						display: flex;
	  						align-items: center; 
	  						image{
	  							width: 120rpx;
	  							height: 120rpx;
	  							border-radius: 50%;
	  						}
	  						.namebox{
	  							margin-left: 20rpx;
	  							.name{
	  							
	  								color: black;
	  							}
	  							.zhichengline{
	  								font-size: 24rpx;
	  								display: flex;
	  								align-items: center;
	  								margin-top: 6rpx;
	  								.itemzhicheng{
	  									padding: 4rpx 8rpx;
	  									background-color: #1a4f8a ;
	  									color: white;
	  								}
	  							}
	  						}
	  					 }
	  					
	  				 }
	  				 .titlebox{
	  					width: 100%;
	  					box-sizing: border-box;
	  					padding: 20rpx;
	  					line-height: 2;
	  					.title{
	  						background-color: #E5E5E5 ;
	  						color: #1a4f8a;
	  						max-width: 40%;
	  						text-align: center;
	  					}
	  					.label{
	  					font-size: 28rpx;
	  					line-height: 1.8;
	  					}
	  				 }
	  				 .sanline{
	  					 width: 100%;
	  					 display: flex;
	  					 justify-content: space-between;
	  					 align-items: center;
	  					 box-sizing: border-box;
	  					 padding: 20rpx;
	  					 .left{
	  						 margin-top: 20rpx;
	  						 font-size: 28rpx;
	  						 line-height: 2;
	  					 }
	  					 .right{
	  						 width: 150rpx;
	  						 height: 150rpx;
	  						image{
	  																 width: 100%;
	  																 height: 100%;
	  						}
	  					 }
	  				 }
	  			 }
	  			 .btnbox{
	  				 width: 100%;
	  				 height: 150rpx;
	  				 margin-top:30rpx;
	  				 display: flex;
	  				 align-items: center;
	  				 justify-content: space-evenly;
					 button{
						 margin: 0;
						 padding: 0;
						 line-height: 50rpx;
						 width: 150rpx;
						  height: 150rpx;
						  border-radius: 30rpx;
						  background-color: white;
						  text-align: center;
						  box-sizing: border-box;
						  padding-top: 40rpx;
						 .iconfont{
						 	 font-size: 44rpx;
						 }
						 .weixin{
						 	color: #40cf3f;
						 }
						 .xiazai{
						 	color: #0099ff;
						 }
						 .lianjie{
						 	color: #999999 ;
						 }
					 }
	  				 .itembtn{
	  					 width: 150rpx;
	  					 height: 150rpx;
	  					 border-radius: 30rpx;
	  					 background-color: white;
	  					 text-align: center;
	  					 box-sizing: border-box;
	  					 padding-top: 40rpx;
	  					.iconfont{
	  						 font-size: 44rpx;
	  					}
	  					.weixin{
	  						color: #40cf3f;
	  					}
	  					.xiazai{
	  						color: #0099ff;
	  					}
	  					.lianjie{
	  						color: #999999 ;
	  					}
	  				 }
	  			 }
	  		 }
	  			 .teamwin{
	  				 width: 90%;
	  				 height: 70%;
	  				 position: absolute;
	  				 top: 10vh;
	  				 bottom: 10vh;
	  				 left: 5%;
	  				 right: 5%;
	  				 box-sizing: border-box;
	  				 background-color: #f1f1f1;
	  				 border-radius: 30rpx;
	  				 padding-top: 40rpx;
	  				 .wintitle{
	  				 	  				 width: 100%;
	  				 	  				 border-top: 1px solid #f1f1f1;
	  				 	  				 text-align: center;
	  				 	  				 position: relative;
	  				 	  				 padding-top: 10rpx;
	  									 color: #1a4f8a;
	  									 font-size: 34rpx;
	  									 font-weight: bold;
	  				 	  				 .iconfont{
	  				 	  					 position: absolute;
	  				 	  					 top: -10rpx;
	  										 color: gray;
	  				 	  					 right: 10rpx;
	  				 	  				 }
	  				 }
	  				 .teamlistbox{
	  					 width: 90%;
	  					 margin: auto;
	  					 padding-top: 40rpx;
	  					 .itemrole{
	  						 width: 100%;
	  						 border: 1rpx solid #1a4f8a;
	  						 border-radius: 10rpx;
	  						 height: 70rpx;
	  						 line-height: 72rpx;
	  						 text-align: center;
	  						 color: #1a4f8a;
	  						 font-weight: bold;
	  						 font-size: 30rpx;
	  						 margin-bottom: 30rpx;
	  					 }
	  				 }
	  			 }
				 .callwin{
					 width: 500rpx;
					 height: 750rpx;
					 border-radius: 20rpx;
					 background: white;
					 margin:20vh auto;
					 box-sizing: border-box;
					 padding: 20rpx;
					 position: relative;
					 .title{
						 text-align: center;
						 font-size: 30rpx;
						 font-weight: bold;
					 }
					 .iconfont{
						 position: absolute;
						 top: 20rpx;
						 right: 20rpx;
					 }
					 image{
						 width: 450rpx;
						 height: 550rpx;
						 margin: 100rpx auto 0 auto;
						 border-radius: 20rpx;
						 
					 }
				 }
	  }
	  
	  
	  
	  .foot-tabbar{
	  	width: 100%;
	  	height: 150rpx;
	  	position: fixed;
	  	left: 0;
	  	right: 0;
	  	bottom: 0;
	  	display: flex;
	  	align-items: center;
	  	justify-content: space-evenly;
	  	background: white;
	  	overflow: visible;  /* 允许溢出 */
	  	
	  	.itemfootbar{
	  		width: 20%;
	  		height: 100%;
	  		text-align: center;
	  		image{
	  			width: 60rpx;
	  			height: 60rpx;
	  			margin: auto;
	  		}
	  		.tabbarname{
	  			font-size: 26rpx;
				font-weight: bold;
	  			color: #969696;
	  		}
	  		.footact{
	  			color: #1a4f8a;
	  		}
	  		
	  	}
	
	  }
	  
	 
  }
</style>
